package com.lyz.services;

import com.lyz.models.Session;
import com.lyz.models.UserVO;
import com.lyz.services.impl.DefaultSessionService;
import org.springframework.stereotype.Service;

@Service
public class CustomSessionService extends DefaultSessionService<UserVO> {

    @Override
    public boolean check(String permission) {
        Session<UserVO> session = this.getSession();
        String userPermission = (String) session.getAttribute("permission");
        return permission.equals(userPermission);
    }

}
